const { app, BrowserWindow } = require("electron")

let mainWindow = null
app.on('ready', () => {
  mainWindow = new BrowserWindow({
    width: 800,
    height: 500,
    webPreferences: { // 设置界面特性
      nodeIntegration: true, // 整合
      contextIsolation: false,
      enableRemoteModule: true
    }
  })
  require("@electron/remote/main").initialize()
  require("@electron/remote/main").enable(mainWindow.webContents)
  mainWindow.webContents.openDevTools();
  mainWindow.loadFile('main.html')
  mainWindow.on("close", () => {
    mainWindow = null
  })
})